<template>
  <a-modal v-model="visible"   :title="title"  @cancel='cancel' @ok='sure'>
    <a-form-model :model="item" :label-col="{span :4 }" :wrapper-col="{ span: 20 }" style="margin-top: 20px">
      <a-form-model-item label="污染大类" required>
        <a-input v-model="item.polluteName"/>
      </a-form-model-item>
    </a-form-model>
  </a-modal>
</template>

<script>

import EpaSortService from '@/myService/EpaSortService'
export default {
  name: 'AddPolluteModal',
  data(){
    return{
      visible:false,
      title:'',
      item:{
        polluteName:'',
      },
      flag:false,
    }
  },
  methods: {
    open() {
      this.visible=true;
      this.item={}
    },
    sure(){
      EpaSortService.addPollute(this.item).then((res)=>{
        console.log(res)
        if(res.result===1){
          this.$message.success("创建成功")
          this.visible=false
        }
      })
      this.$emit('loading')
    },
    cancel(){
      this.visible=false
    }

  }
}
</script>

<style scoped>

</style>